package com.way.designpatterncodepratice.proxy.other;

/**
 * @author wayleung
 * @description
 * @date 2020-08-12 09:44:47
 */
public class Proxy implements TargetInterface {

    private TargetInterface targetInterface;

    public Proxy(TargetInterface targetInterface) {
        this.targetInterface = targetInterface;
    }

    @Override
    public String sayHello(String name) {
        System.out.println("代理前做点东西");
        String result = targetInterface.sayHello(name);
        System.out.println("代理后做点东西");
        return result;
    }
}
